package com.corpgovernment.supplier.controller;

import com.corpgovernment.api.supplier.soa.request.QueryEnableCorpPayTypeRequest;
import com.corpgovernment.api.supplier.soa.response.MbSupplierCompanyVoResponse;
import com.corpgovernment.api.supplier.vo.MbSupplierCompanyVo;
import com.corpgovernment.common.base.JSONResult;
import com.corpgovernment.supplier.service.MbSupplierCompanyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;
import java.util.List;

/**
 * @auth:yaqiangzhang
 * @date:2019/7/29 16:02
 */
@RestController
@RequestMapping("mbSupplierCompany")
public class MbSupplierCompanyController {

    @Autowired
    private MbSupplierCompanyService mbSupplierCompanyService;

    /**
     * 获取是否有提供服务的因公因私供应商
     */
    @RequestMapping(value = "/queryEnableCorpPayType")
    public JSONResult<List<String>> queryEnableCorpPayType(@RequestBody @Valid QueryEnableCorpPayTypeRequest request) {
        return mbSupplierCompanyService.queryEnableCorpPayType(request);
    }

    /**
     * 获取供应商信息
     *
     * @param request
     * @return
     */
    @RequestMapping("/getMbSupplierCompany")
    public JSONResult<MbSupplierCompanyVoResponse> getMbSupplierCompany(@RequestBody MbSupplierCompanyVo request) {
        return mbSupplierCompanyService.getMbSupplierCompany(request);
    }
}
